package org.example.hello6_MessageConfirmation;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerController {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @GetMapping("/send")
    public String send() {

        rabbitTemplate.convertAndSend("data", "mac_key", "mac信息");
        System.out.println("消息发送成功");
        return "success";
    }



}
